Step 3 - Fine-tune the bloom effect

In this step you fine-tune the bloom effect by reapplying it three times. To make the effect spread to a wider area and look more realistic, you adjust the settings of the blur and the intensity of the bloom in each pass.

To fine-tune the bloom effect:

  1. Create three more passes of the bloom effect:
    1. In the Library hold down the Ctrl key, select the Horizontal Bloom 1 and Vertical Bloom 1 render passes, duplicate them, and rename the new render passes to Horizontal Bloom 2 and Vertical Bloom 2.
    2. Repeat the previous step twice but rename the render passes to:
      • Horizontal Bloom 3 and Vertical Bloom 3
      • Horizontal Bloom 4 and Vertical Bloom 4
    3. In the Library drag the Bloom Out render pass below the Vertical Bloom 4 render pass.
    4. In the Library select the Bloom Out > Blit Combined Bloom render pass and in the Properties add and set:
      • Texture1 to Vertical Bloom 2
      • Texture2 to Vertical Bloom 3
      • Texture3 to Vertical Bloom 4
      This way you set the render pass to render the Vertical Bloom 1, Vertical Bloom 2, Vertical Bloom 3, and Vertical Bloom 4 render passes using the CombineMaterial.
  2. Load these material types from <KanziWorkspace>/Tutorials/Bloom/Assets:The GaussianBloom09Material, GaussianBloom13Material, and GaussianBloom15Material materials provide a directional Gaussian blur effect using kernel sizes of 9, 13, and 15 pixels. To optimize performance you use smaller kernel sizes when possible.
  3. Adjust the spread and intensity of the bloom effect:
    1. For each Composition Target Render Pass you created in the previous step set the Resolution Divisor property to the value listed in this table:

      Composition Target Render PassResolution Divisor
      Horizontal Bloom 28
      Vertical Bloom 28
      Horizontal Bloom 316
      Vertical Bloom 316
      Horizontal Bloom 432
      Vertical Bloom 432
        
      This way you reduce the resolution of the composition target at every pass of the bloom effect, making the effect spread to a wider area.
    2. For each Blit Render Pass you created earlier in this procedure set the properties to the values listed in this table:

      Blit Render PassTexture0MaterialBlur Direction XBlur Direction YBlur RadiusIntensity
      Horizontal Bloom 2
      > Blit Horizontal Bloom
      Vertical Bloom 1GaussianBloom09Material1041
      Vertical Bloom 2
      > Blit Vertical Bloom
      Horizontal Bloom 2GaussianBloom09Material00,2541
      Horizontal Bloom 3
      > Blit Horizontal Bloom
      Vertical Bloom 2GaussianBloom13Material1042,5
      Vertical Bloom 3
      > Blit Vertical Bloom
      Horizontal Bloom 3GaussianBloom13Material00,542,5
      Horizontal Bloom 4
      > Blit Horizontal Bloom
      Vertical Bloom 3GaussianBloom15Material1042
      Vertical Bloom 4
      > Blit Vertical Bloom
      Horizontal Bloom 4GaussianBloom15Material00,542
             
    3. In the Library select the Bloom Out > Blit Combined Bloom render pass, and in the Properties add and set:
      • Pass 1 Multiplier to 1
      • Pass 2 Multiplier to 1,4
      • Pass 3 Multiplier to 1,5
      • Pass 4 Multiplier to 1,3
      You use these properties to set weights for the Vertical Bloom 1, Vertical Bloom 2, Vertical Bloom 3, and Vertical Bloom 4 render passes, which the Blit Combined Bloom renders.
      You can experiment with different multiplier values to see how each pass of the bloom effect affects the final outcome.
  4. In the Preview click and drag the car to see how the bloom effect looks when the car rotates.


< PREVIOUS STEP

What's next?

In this tutorial you learned how to use render passes and shaders to apply a bloom effect on 3D content.

Now you can:

See also

To learn more about the render passes in Kanzi, see Rendering.